package com.kyxx.mycommonproject.cainixihua;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;

import com.bartoszlipinski.recyclerviewheader2.RecyclerViewHeader;
import com.kyxx.mycommonproject.R;
import com.kyxx.mycommonproject.base.BaseActivity0;
import com.kyxx.mycommonproject.dianpu.*;
import com.kyxx.mycommonproject.dianpu.DividerGridItemDecoration;
import com.kyxx.mycommonproject.widget.GridViewForScrollView;

public class CaiNiXiHuanActivity extends BaseActivity0 {
    private GridViewForScrollView gv;
//    private RecyclerViewHeader rvh;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cai_ni_xi_huan);
        gv = (GridViewForScrollView) findViewById(R.id.gv);
        gv.setFocusable(false);
        GridViewAdapter gridViewAdapter = new GridViewAdapter();
        gv.setAdapter(gridViewAdapter);
    }

    @Override
    protected void loadViewLayout() {

    }

    @Override
    protected void findViewById() {

    }

    @Override
    protected void setListener() {

    }

    @Override
    protected void processLogic() {

    }

    class GridViewAdapter extends BaseAdapter {
        @Override
        public int getCount() {
            return 20;
        }

        @Override
        public Object getItem(int i) {
            return null;
        }

        @Override
        public long getItemId(int i) {
            return 0;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            ViewHolder holder;
            if (view == null) {
                holder = new ViewHolder();
                view = View.inflate(context, R.layout.item_gridview_good, null);
                holder.tv_good = (TextView) view.findViewById(R.id.tv_good);
                holder.iv_good = (ImageView) view.findViewById(R.id.iv_good);
                holder.tv_price = (TextView) view.findViewById(R.id.tv_price);
                holder.tv_people = (TextView) view.findViewById(R.id.tv_people);
                view.setTag(holder);
            } else {
                holder = (ViewHolder) view.getTag();
            }
            return view;
        }
    }

    class ViewHolder {
        private TextView tv_good;
        private ImageView iv_good;
        private TextView tv_price;
        private TextView tv_people;
    }
}
